import subprocess

def play_video(path: str):
    if path.startswith('https://') or path.startswith('http://'):
        from .download_video import download_video
        result = download_video(path)
        if 'path' not in result:
            return result
        path = result.pop('path')
        subprocess.Popen(['vlc', '--one-instance', '--', path])
        result['playing'] = True
        return result
    subprocess.Popen(['vlc', '--one-instance', '--', path])
    return {'playing': True}
